#include "cpu/exec/template-start.h"

#define instr cmp

static void do_execute() {
	DATA_TYPE result = op_dest->val - op_src->val;             //DATA_TYPE本质上是根据你在data_byte的操作数大小，来决定是uint8_t,16,32...
  	update_eflags_pf_zf_sf((DATA_TYPE_S)result);              //一种一键确定pf。zf，sf的函数,这里的data_type_s不是uint是int？
	//注意，cmp与add不同，只读不写
	cpu.eflags.CF = op_dest->val < op_src->val;
 	cpu.eflags.OF = MSB((op_dest -> val ^ op_src -> val) & (~(op_src -> val ^ result)));
	print_asm_template2();          //打印反汇编结果
}

#if DATA_BYTE == 2 || DATA_BYTE == 4
make_instr_helper(si2rm)
#endif

make_instr_helper(i2a)
make_instr_helper(i2rm)
make_instr_helper(r2rm)
make_instr_helper(rm2r)

#include "cpu/exec/template-end.h"